<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div class="app">

        <!-- 普通数组： -->
        <p v-for='(item, i) in arr'>{{item}}----索引{{i}}</p>

        <!-- 对象数组： -->
        <p v-for="(user, i) in last">Id：{{ user.id }} --- 名字：{{ user.name }}
            --- 索引：{{i}}</p>

        <!-- 对象： -->
        <p v-for='(val, key, i) in list'>值是{{val}},键是{{key}}</p>
    </div>

    <script src="./node_modules/_vue@2.5.22@vue/dist/vue.js"></script>
    <script>
        var a = new Vue({
            //el指向需要控制的元素
            el: '.app',
            //data 存放数据;
            data: {
                arr: [1, 2, 3, 4, 5],
                last: [
                    {id: 1,name: 'zs1'},
                    {id: 2,name: 'zs2'}
                ],
                list: {
                    id: 1,
                    name: "狗子",
                    gender: '未知'
                }
            }
        })
    </script>
</body>

</html>